Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nanoseconds to stdout plugin #1249

Merged
merged 1 commit into from
Sep 28, 2016
Merged

Conversation

luhn
Copy link
Contributor

@luhn luhn commented Sep 27, 2016

Now that Fluentd supports nanosecond-resolution timestamps as of v0.14,
it follows that the stdout output plugin should print the full
timestamp.

This is a very simple patch, instead of using the default to_s
formatting, we call strftime with a custom formatting.

Right now it always prints the nanoseconds, even on second-resolution
timestamps. This means second-resolution timestamps will display like
2013-06-27 12:34:56.000000000 -0700, which may be undesirable. If so,
we can adjust the implement to print a condensed formatting for
second-resolution timestamps.

Now that Fluentd supports nanosecond-resolution timestamps as of v0.14,
it follows that the stdout output plugin should print the full
timestamp.

This is a very simple patch, instead of using the default `to_s`
formatting, we call `strftime` with a custom formatting.

Right now it always prints the nanoseconds, even on second-resolution
timestamps.  This means second-resolution timestamps will display like
`2013-06-27 12:34:56.000000000 -0700`, which may be undesirable.  If so,
we can adjust the implement to print a condensed formatting for
second-resolution timestamps.
@tagomoris
Copy link
Member

This change looks reasonable, and good to me.
Changing default format is breaking change and undesirable for many cases... but it's about out_stdout. I believe it's ok.

@repeatedly ?

@repeatedly
Copy link
Member

LGTM.

Changing out_stdout's result should not affect any production.

@tagomoris tagomoris added enhancement Feature request or improve operations v0.14 labels Sep 28, 2016
@tagomoris tagomoris merged commit fc67f70 into fluent:master Sep 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request or improve operations v0.14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants